package com.bolao;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ListView;
import android.widget.TextView;

import com.Adapter.GroupListAdapter;
import com.Adapter.MatchAdapter;
import com.entidades.Group;

public class MainGrupoActivity extends Activity {

private static Group group;
private ListView listViewScore;
private TextView groupTitle;
private ListView listViewMatchs;

	public static void setGroup(Group group) {
		MainGrupoActivity.group = group;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main_grupo);
		listViewScore = (ListView) findViewById(R.id.listViewScore);
		listViewScore.setAdapter(new GroupListAdapter(getApplicationContext(), group));
		groupTitle = (TextView) findViewById(R.id.textViewGroupDesc);
		groupTitle.setText((getString(R.string.group) + " " + group.getId()).toUpperCase());
		listViewMatchs = (ListView) findViewById(R.id.listViewNextGroupMatchs);
		listViewMatchs.setAdapter(new MatchAdapter(getApplicationContext(), group.getMatchList(), false));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main_grupo, menu);
		return true;
	}

}
